import request from '../utils/request'

export function listPositions(params) {
  return request({
    url: '/api/position/list',
    method: 'get',
    params,
  })
}

export function getPositionStats() {
  return request({
    url: '/api/position/stats',
    method: 'get'
  })
}

export function getApplicationStats() {
  return request({
    url: '/api/position/application-stats',
    method: 'get'
  })
}

export function getTeacherPositionStats() {
  return request({
    url: '/api/position/teacher-stats',
    method: 'get'
  })
}

export function getPositionById(id) {
  return request({
    url: `/api/position/${id}`,
    method: 'get',
  })
}

export function getAllTeachers() {
  return request({
    url: '/api/teacher/list',
    method: 'get',
    params: { isDeleted: 0 }
  })
}

export function addPosition(data) {
  return request({
    url: '/api/position/add',
    method: 'post',
    data,
  })
}

export function updatePosition(data) {
  return request({
    url: '/api/position/update',
    method: 'put',
    data,
  })
}

export function deletePosition(id) {
  return request({
    url: `/api/position/delete/${id}`,
    method: 'delete',
  })
}